package com.hnas.sys.service.system.mapper;
import com.hnas.core.mapper.Mapper;
import com.hnas.sys.orm.LogInfo;
import com.hnas.sys.service.system.dto.DTOLog;

public class LogMapper extends Mapper<DTOLog, LogInfo> {
	private static LogMapper logMapper;
	
	private LogMapper() {
		super(DTOLog.class, LogInfo.class);
	}
	
	public static LogMapper getInstance() {
		if (logMapper == null) {
			logMapper = new LogMapper();
		}
		return logMapper;
	}
	public DTOLog mapToValue(LogInfo entity) {
		if(null != entity) {
			DTOLog value = super.mapToValue(entity);
//			其余属性
//			value.setObjectTypeName(entity.getObjectType().getObjectTypeName());
			value.setOperatorName(entity.getOperator().getName());
			return value;
		}
		return null;
	}
}
